import Cookies from "js-cookie";
import { TOKEN_KEY } from "@/constant/index";
// 变量
const tokenKey = TOKEN_KEY;
// 获取token
export function getToken() {
  return Cookies.get(tokenKey);
}
// 写入token
export function setToken(value: string): void {
  Cookies.set(tokenKey, value);
}
// 删除token
export function removeToken(): void {
  Cookies.remove(tokenKey);
}
// 写入userName
export function setCookies(key: string, value: string): void {
  Cookies.set(key, value);
}
// 清除token
export function removeCookies(key: string): void {
  Cookies.remove(key);
}
// 获取某个key
export function getCookiesKey(key: string) {
  return Cookies.get(key);
}
